$('.sel_input>input').on('input',function(){
    console.log(this.value)
    const text = this.value
    $.ajax({
        url:'/shop_sel',
        data:{
            ajax: 1,
            csrf_token: 'c319200382fddb6a3387f297dea14840',
            logid: 3439079469256432605,
            fid: '0,1633741091629',
            _: new Date().getTime(),
            q: text,
        },
        dataType:'json',
        success:function(res){
            const arr = res.data[1].data
            let text = ''
            arr.forEach(item=>{
                text += `
                <li>
                    <span>
                        ${item.word}
                    </span>
                    <p>
                        约${item.skuSize}个
                    </p>
                </li>
                `
                
            })
            $(".sel_result").css('display','block')
            $(".sel_result").html(text)
        },
        error:function(err){
            $(".sel_result").html('暂无结果')
        }
    })
    
})
$('.sel_input>input').focus(function(){
    $('.sel_result').css('display','block')
})
$('.sel_input>input').blur(function(){
    $('.sel_result').css('display','none')
})

const carList = JSON.parse(localStorage.getItem('cart'))
console.log(carList)
let foodsText = ''
carList.forEach(item=>{
    foodsText += `
        <div class="every_foods">
            <div class="every_foods_shop">
                <input type="checkbox" name="shopselect" id="shopselect"><span>${item.fullProviderName}</span>
            </div>
            <div class="every_foods_info">
                <input type="checkbox" name="foodsselect" id="foodsselect">
                <img src="${item.img}" alt="">
                <p class="every_foods_title">${item.title}</p>
                <div>
                    <span class="reduce">-</span>
                    <span class="number">1</span>
                    <span class="add">+</span>
                </div>
                <span class="oneprice">>=1台:${item.price}${item.pCurrency}</span>
                <span class="allprice">29.70</span>
                <button>删除</button>
            </div>
        </div>

`
})
$('.cart_foods').html(foodsText)
$('.cart_foods>.every_foods>.every_foods_info>button').click(function(){
    
})